home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9905 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 74 6e 65 77 73 2e 77 6f |Path: ne|tnews.wo|
|00000010| 72 6c 64 6e 65 74 2e 61 | 74 74 2e 6e 65 74 21 6e |rldnet.a|tt.net!n|
|00000020| 65 77 73 61 64 6d 0a 46 | 72 6f 6d 3a 20 41 72 6e |ewsadm.F|rom: Arn|
|00000030| 20 54 72 65 6d 62 6c 65 | 79 20 3c 61 72 6e 6f 6c | Tremble|y <arnol|
|00000040| 64 2e 74 72 65 6d 62 6c | 65 79 40 77 6f 72 6c 64 |d.trembl|ey@world|
|00000050| 6e 65 74 2e 61 74 74 2e | 6e 65 74 3e 0a 4e 65 77 |net.att.|net>.New|
|00000060| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000070| 6e 67 2e 63 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |ng.c.Sub|ject: Re|
|00000080| 3a 20 6e 65 65 64 20 41 | 6c 67 6f 72 69 74 68 6d |: need A|lgorithm|
|00000090| 20 2d 20 6a 75 6c 69 61 | 6e 20 64 61 79 20 74 6f | - julia|n day to|
|000000a0| 20 63 61 6c 65 6e 64 61 | 72 0a 44 61 74 65 3a 20 | calenda|r.Date: |
|000000b0| 31 34 20 4d 61 72 20 31 | 39 39 36 20 30 37 3a 30 |14 Mar 1|996 07:0|
|000000c0| 39 3a 32 35 20 47 4d 54 | 0a 4f 72 67 61 6e 69 7a |9:25 GMT|.Organiz|
|000000d0| 61 74 69 6f 6e 3a 20 41 | 54 26 54 20 57 6f 72 6c |ation: A|T&T Worl|
|000000e0| 64 4e 65 74 20 53 65 72 | 76 69 63 65 73 0a 4d 65 |dNet Ser|vices.Me|
|000000f0| 73 73 61 67 65 2d 49 44 | 3a 20 3c 34 69 38 67 6e |ssage-ID|: <4i8gn|
|00000100| 35 24 68 70 70 40 6d 74 | 69 6e 73 63 30 31 2d 6d |5$hpp@mt|insc01-m|
|00000110| 67 74 2e 6f 70 73 2e 77 | 6f 72 6c 64 6e 65 74 2e |gt.ops.w|orldnet.|
|00000120| 61 74 74 2e 6e 65 74 3e | 0a 52 65 66 65 72 65 6e |att.net>|.Referen|
|00000130| 63 65 73 3a 20 3c 46 49 | 47 2e 39 36 4d 61 72 31 |ces: <FI|G.96Mar1|
|00000140| 33 31 38 31 32 35 38 40 | 72 6f 63 6b 2e 6f 72 61 |3181258@|rock.ora|
|00000150| 2e 63 6f 6d 3e 0a 4e 4e | 54 50 2d 50 6f 73 74 69 |.com>.NN|TP-Posti|
|00000160| 6e 67 2d 48 6f 73 74 3a | 20 32 35 2e 73 74 2d 6c |ng-Host:| 25.st-l|
|00000170| 6f 75 69 73 2d 32 2e 6d | 6f 2e 64 69 61 6c 2d 61 |ouis-2.m|o.dial-a|
|00000180| 63 63 65 73 73 2e 61 74 | 74 2e 6e 65 74 0a 4d 69 |ccess.at|t.net.Mi|
|00000190| 6d 65 2d 56 65 72 73 69 | 6f 6e 3a 20 31 2e 30 0a |me-Versi|on: 1.0.|
|000001a0| 43 6f 6e 74 65 6e 74 2d | 54 79 70 65 3a 20 74 65 |Content-|Type: te|
|000001b0| 78 74 2f 70 6c 61 69 6e | 3b 20 63 68 61 72 73 65 |xt/plain|; charse|
|000001c0| 74 3d 75 73 2d 61 73 63 | 69 69 0a 43 6f 6e 74 65 |t=us-asc|ii.Conte|
|000001d0| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|000001e0| 64 69 6e 67 3a 20 37 62 | 69 74 0a 58 2d 4d 61 69 |ding: 7b|it.X-Mai|
|000001f0| 6c 65 72 3a 20 4d 6f 7a | 69 6c 6c 61 20 31 2e 32 |ler: Moz|illa 1.2|
|00000200| 32 41 54 54 20 28 57 69 | 6e 64 6f 77 73 3b 20 55 |2ATT (Wi|ndows; U|
|00000210| 3b 20 31 36 62 69 74 29 | 0a 54 6f 3a 20 66 69 67 |; 16bit)|.To: fig|
|00000220| 40 72 6f 63 6b 2e 6f 72 | 61 2e 63 6f 6d 0a 0a 66 |@rock.or|a.com..f|
|00000230| 69 67 40 72 6f 63 6b 2e | 6f 72 61 2e 63 6f 6d 20 |ig@rock.|ora.com |
|00000240| 28 53 74 65 70 68 65 6e | 20 52 2e 20 46 69 67 67 |(Stephen| R. Figg|
|00000250| 69 6e 73 29 20 77 72 6f | 74 65 3a 0a 3e 49 20 68 |ins) wro|te:.>I h|
|00000260| 61 76 65 20 61 6e 20 61 | 6c 67 6f 72 69 74 68 6d |ave an a|lgorithm|
|00000270| 20 66 6f 72 20 63 6f 6e | 76 65 72 74 69 6e 67 20 | for con|verting |
|00000280| 63 61 6c 65 6e 64 61 72 | 20 64 61 79 73 20 74 6f |calendar| days to|
|00000290| 20 4a 75 6c 69 61 6e 2c | 20 62 75 74 20 49 20 6e | Julian,| but I n|
|000002a0| 65 65 64 0a 3e 61 20 67 | 6f 6f 64 20 61 6c 67 6f |eed.>a g|ood algo|
|000002b0| 72 69 74 68 6d 20 74 6f | 20 63 6f 6e 76 65 72 74 |rithm to| convert|
|000002c0| 20 74 68 65 6d 20 62 61 | 63 6b 20 61 67 61 69 6e | them ba|ck again|
|000002d0| 2e 20 20 41 6e 79 6f 6e | 65 20 68 61 70 70 65 6e |. Anyon|e happen|
|000002e0| 20 74 6f 20 6b 6e 6f 77 | 0a 3e 77 68 61 74 20 74 | to know|.>what t|
|000002f0| 68 61 74 20 61 6c 67 6f | 20 69 73 3f 20 20 50 6c |hat algo| is? Pl|
|00000300| 65 61 73 65 20 65 6d 61 | 69 6c 20 69 74 20 74 6f |ease ema|il it to|
|00000310| 20 6d 65 21 20 20 54 68 | 61 6e 6b 73 21 0a 3e 0a | me! Th|anks!.>.|
|00000320| 3e 0a 3e 2d 2d 0a 3e 53 | 74 65 70 68 65 6e 20 52 |>.>--.>S|tephen R|
|00000330| 2e 20 46 69 67 67 69 6e | 73 0a 3e 66 69 67 40 6f |. Figgin|s.>fig@o|
|00000340| 72 61 2e 63 6f 6d 0a 3e | 68 74 74 70 3a 2f 2f 74 |ra.com.>|http://t|
|00000350| 65 63 68 2e 6f 72 61 2e | 63 6f 6d 2f 66 69 67 2f |ech.ora.|com/fig/|
|00000360| 0a 3e 0a 0a 49 20 67 65 | 6e 65 72 61 6c 6c 79 20 |.>..I ge|nerally |
|00000370| 63 72 65 61 74 65 20 61 | 20 63 6f 75 70 6c 65 20 |create a| couple |
|00000380| 6f 66 20 61 72 72 61 79 | 73 2e 20 20 4c 6f 67 69 |of array|s. Logi|
|00000390| 63 61 6c 6c 79 20 69 74 | 20 77 6f 72 6b 73 20 6c |cally it| works l|
|000003a0| 69 6b 65 20 74 68 69 73 | 3a 0a 0a 4d 4f 4e 54 48 |ike this|:..MONTH|
|000003b0| 20 20 20 20 20 4e 4f 52 | 4d 41 4c 2d 59 45 41 52 | NOR|MAL-YEAR|
|000003c0| 20 20 4c 45 41 50 2d 59 | 45 41 52 0a 4a 41 4e 20 | LEAP-Y|EAR.JAN |
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 30 20 20 20 | | 0 |
|000003e0| 20 20 20 20 20 20 20 30 | 0a 46 45 42 20 20 20 20 | 0|.FEB |
|000003f0| 20 20 20 20 20 20 20 20 | 33 31 20 20 20 20 20 20 | |31 |
|00000400| 20 20 20 33 31 0a 4d 41 | 52 20 20 20 20 20 20 20 | 31.MA|R |
|00000410| 20 20 20 20 20 35 39 20 | 20 20 20 20 20 20 20 20 | 59 | |
|00000420| 36 30 0a 41 50 52 20 20 | 20 20 20 20 20 20 20 20 |60.APR | |
|00000430| 20 20 39 30 20 20 20 20 | 20 20 20 20 20 39 31 0a | 90 | 91.|
|00000440| 4d 41 59 20 20 20 20 20 | 20 20 20 20 20 20 31 32 |MAY | 12|
|00000450| 30 20 20 20 20 20 20 20 | 20 31 32 31 0a 4a 55 4e |0 | 121.JUN|
|00000460| 20 20 20 20 20 20 20 20 | 20 20 20 31 35 31 20 20 | | 151 |
|00000470| 20 20 20 20 20 20 31 35 | 32 0a 4a 55 4c 20 20 20 | 15|2.JUL |
|00000480| 20 20 20 20 20 20 20 20 | 31 38 31 20 20 20 20 20 | |181 |
|00000490| 20 20 20 31 38 32 0a 41 | 55 47 20 20 20 20 20 20 | 182.A|UG |
|000004a0| 20 20 20 20 20 32 31 32 | 20 20 20 20 20 20 20 20 | 212| |
|000004b0| 32 31 33 0a 53 45 50 20 | 20 20 20 20 20 20 20 20 |213.SEP | |
|000004c0| 20 20 32 34 33 20 20 20 | 20 20 20 20 20 32 34 34 | 243 | 244|
|000004d0| 0a 4f 43 54 20 20 20 20 | 20 20 20 20 20 20 20 32 |.OCT | 2|
|000004e0| 37 33 20 20 20 20 20 20 | 20 20 32 37 34 0a 4e 4f |73 | 274.NO|
|000004f0| 56 20 20 20 20 20 20 20 | 20 20 20 20 33 30 34 20 |V | 304 |
|00000500| 20 20 20 20 20 20 20 33 | 30 35 0a 44 45 43 20 20 | 3|05.DEC |
|00000510| 20 20 20 20 20 20 20 20 | 20 33 33 34 20 20 20 20 | | 334 |
|00000520| 20 20 20 20 33 33 35 0a | 0a 4f 62 76 69 6f 75 73 | 335.|.Obvious|
|00000530| 6c 79 2c 20 74 68 65 20 | 61 72 72 61 79 73 20 63 |ly, the |arrays c|
|00000540| 6f 6e 74 61 69 6e 20 74 | 68 65 20 6e 75 6d 62 65 |ontain t|he numbe|
|00000550| 72 20 6f 66 20 64 61 79 | 73 20 69 6e 20 74 68 65 |r of day|s in the|
|00000560| 20 6d 6f 6e 74 68 73 20 | 70 72 69 6f 72 20 74 6f | months |prior to|
|00000570| 20 0a 74 68 65 20 6d 6f | 6e 74 68 20 69 6e 20 74 | .the mo|nth in t|
|00000580| 68 65 20 63 75 72 72 65 | 6e 74 20 61 72 72 61 79 |he curre|nt array|
|00000590| 20 70 6f 73 69 74 69 6f | 6e 2e 20 20 4e 6f 77 20 | positio|n. Now |
|000005a0| 74 6f 20 63 6f 6e 76 65 | 72 74 20 30 35 2f 32 35 |to conve|rt 05/25|
|000005b0| 2f 31 39 39 36 20 69 6e | 74 6f 20 0a 61 20 4a 75 |/1996 in|to .a Ju|
|000005c0| 6c 69 61 6e 20 64 61 74 | 65 20 77 65 20 75 73 65 |lian dat|e we use|
|000005d0| 20 74 68 65 20 6c 65 61 | 70 2d 79 65 61 72 20 74 | the lea|p-year t|
|000005e0| 61 62 6c 65 2e 20 20 57 | 65 20 67 65 74 20 74 68 |able. W|e get th|
|000005f0| 65 20 31 32 31 20 66 6f | 72 20 4d 61 79 20 61 6e |e 121 fo|r May an|
|00000600| 64 20 61 64 64 20 0a 74 | 68 65 20 32 35 20 74 6f |d add .t|he 25 to|
|00000610| 20 67 65 74 20 31 39 39 | 36 2f 31 34 36 2e 20 20 | get 199|6/146. |
|00000620| 0a 0a 43 6f 6e 76 65 72 | 74 69 6e 67 20 66 72 6f |..Conver|ting fro|
|00000630| 6d 20 4a 75 6c 69 61 6e | 20 62 61 63 6b 20 74 6f |m Julian| back to|
|00000640| 20 47 72 65 67 6f 72 69 | 61 6e 20 69 73 20 61 20 | Gregori|an is a |
|00000650| 6c 69 74 74 6c 65 20 64 | 69 66 66 65 72 65 6e 74 |little d|ifferent|
|00000660| 2e 20 20 57 65 20 66 69 | 72 73 74 20 0a 64 65 74 |. We fi|rst .det|
|00000670| 65 72 6d 69 6e 65 20 69 | 66 20 69 74 27 73 20 61 |ermine i|f it's a|
|00000680| 20 6c 65 61 70 20 79 65 | 61 72 2c 20 73 6f 20 77 | leap ye|ar, so w|
|00000690| 65 20 6b 6e 6f 77 20 77 | 68 69 63 68 20 61 72 72 |e know w|hich arr|
|000006a0| 61 79 20 74 6f 20 73 65 | 61 72 63 68 2e 20 20 54 |ay to se|arch. T|
|000006b0| 68 65 6e 20 77 65 20 0a | 73 65 61 72 63 68 20 74 |hen we .|search t|
|000006c0| 68 65 20 61 72 72 61 79 | 20 42 41 43 4b 57 41 52 |he array| BACKWAR|
|000006d0| 44 53 20 61 6e 64 20 74 | 68 65 20 66 69 72 73 74 |DS and t|he first|
|000006e0| 20 6d 6f 6e 74 68 20 65 | 6c 65 6d 65 6e 74 20 77 | month e|lement w|
|000006f0| 68 69 63 68 20 63 6f 6e | 74 61 69 6e 73 20 61 20 |hich con|tains a |
|00000700| 0a 6e 75 6d 62 65 72 20 | 6f 66 20 64 61 79 73 20 |.number |of days |
|00000710| 6c 65 73 73 20 74 68 61 | 6e 20 6f 75 72 20 6a 75 |less tha|n our ju|
|00000720| 6c 69 61 6e 20 64 61 74 | 65 20 69 73 20 6f 75 72 |lian dat|e is our|
|00000730| 20 6d 6f 6e 74 68 2c 20 | 73 6f 20 77 65 20 73 75 | month, |so we su|
|00000740| 62 74 72 61 63 74 20 0a | 74 68 61 74 20 76 61 6c |btract .|that val|
|00000750| 75 65 20 66 72 6f 6d 20 | 6f 75 72 20 4a 64 61 79 |ue from |our Jday|
|00000760| 73 20 61 6e 64 20 74 68 | 65 20 72 65 6d 61 69 6e |s and th|e remain|
|00000770| 64 65 72 20 69 73 20 74 | 68 65 20 64 61 79 20 6f |der is t|he day o|
|00000780| 66 20 74 68 65 20 6d 6f | 6e 74 68 2e 0a 0a 46 6f |f the mo|nth...Fo|
|00000790| 72 20 65 78 61 6d 70 6c | 65 2c 20 31 39 39 35 2f |r exampl|e, 1995/|
|000007a0| 32 39 39 20 69 73 20 6e | 6f 74 20 61 20 6c 65 61 |299 is n|ot a lea|
|000007b0| 70 20 79 65 61 72 20 73 | 6f 20 77 65 20 67 65 74 |p year s|o we get|
|000007c0| 20 32 37 33 20 66 72 6f | 6d 20 6f 75 72 20 74 61 | 273 fro|m our ta|
|000007d0| 62 6c 65 20 66 6f 72 20 | 0a 74 68 65 20 6d 6f 6e |ble for |.the mon|
|000007e0| 74 68 20 6f 66 20 4f 63 | 74 6f 62 65 72 2e 20 20 |th of Oc|tober. |
|000007f0| 4f 63 74 6f 62 65 72 20 | 73 68 6f 75 6c 64 20 62 |October |should b|
|00000800| 65 20 74 72 61 6e 73 6c | 61 74 65 64 20 74 6f 20 |e transl|ated to |
|00000810| 6d 6f 6e 74 68 20 31 30 | 2e 20 20 57 65 20 0a 73 |month 10|. We .s|
|00000820| 75 62 74 72 61 63 74 20 | 32 37 33 20 66 72 6f 6d |ubtract |273 from|
|00000830| 20 32 39 39 20 61 6e 64 | 20 6f 75 72 20 64 61 74 | 299 and| our dat|
|00000840| 65 20 69 73 20 31 30 2f | 32 36 2f 31 39 39 35 2e |e is 10/|26/1995.|
|00000850| 0a 0a 49 20 6c 65 61 76 | 65 20 74 68 65 20 64 65 |..I leav|e the de|
|00000860| 74 61 69 6c 73 20 6f 66 | 20 74 68 65 20 69 6d 70 |tails of| the imp|
|00000870| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 74 6f 20 79 |lementat|ion to y|
|00000880| 6f 75 2e 0a 0a 50 65 72 | 68 61 70 73 20 73 6f 6d |ou...Per|haps som|
|00000890| 65 6f 6e 65 20 65 6c 73 | 65 20 77 69 6c 6c 20 70 |eone els|e will p|
|000008a0| 6f 73 74 20 61 20 6d 6f | 72 65 20 65 6c 65 67 61 |ost a mo|re elega|
|000008b0| 6e 74 20 73 6f 6c 75 74 | 69 6f 6e 2e 20 20 20 20 |nt solut|ion. |
|000008c0| 20 0a 0a 0a | | ... | |
+--------+-------------------------+-------------------------+--------+--------+